Add --send-all flag for bulk-sending after a recent dry-run#90
Merged
Conversation
A hand-edited *_followup_assessments.csv row with an empty
question_mode cell parses as NaN via pd.read_csv. NaN is truthy in
Python, so `(rows[0].get('question_mode') or 'explain').lower()`
would call `.lower()` on a float and raise AttributeError instead
of falling back. Guard explicitly via pd.isna + a non-empty-string
check, then default to 'explain'.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--send-all/-sflag to the four tasks that loop and prompt[y/N]per student:send-quiz-reminder(single +--all),send-follow-up-question,send-follow-up-assessments. After a clean--dry-runthe second pass is just rote keystrokes; this flag skips the prompt.--send-allis rejected when combined with--dry-run, and only honored if a--dry-runof the same task wrote its dated*_dryrun_*.csvmanifest in the last 10 minutes (forces the instructor to inspect the preview first).send-follow-up-assessments --dry-runpreviously wrote nothing; it now also drops a small*_assessments_sent_dryrun_YYYYMMDD.csvso the recency check has an mtime anchor consistent with the other affected tasks.canvigator_digest._summarizeFollowupThemesagainst a NaN/emptyquestion_modecell (NaN is truthy, so the old(... or 'explain').lower()wouldAttributeErroron a hand-edited assessments CSV instead of falling back).Test plan
flake8clean on both passespytest— 294/294 pass (9 new tests: recency helper,_interactiveSendwith/withoutsend_all,_sendOneAssessmentwithsend_all, conflict guard via subprocess for long + short forms, plus 3 NaN-mode digest tests)python canvigator.py send-follow-up-assessments --helpshows-s, --send-alland the new examplepython canvigator.py --dry-run --send-all send-follow-up-assessmentsexits non-zero with a clear error--dry-runthen--send-allwithin 10 minutes — no per-student prompt, all unsent rows post and flip tosent_assessment=1, persistent CSV updated🤖 Generated with Claude Code